package com.lanmaoly.cunzheng;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressTest {

    public static void main(String[] args) throws UnknownHostException {
        InetAddress address = InetAddress.getLocalHost();
        String hostAddress = address.getHostAddress();
        String hostName = address.getHostName();
        System.out.println(hostAddress);
        System.out.println(hostName);
    }
}
